package DD4;

public class ByRunnable {

	public static void main(String[] args) {
		ByB B1 = new ByB();
		Thread T1 = new Thread(B1);
		Thread T2 = new Thread(B1);
		T1.setName("t1 ");
		T2.setName("t2 ");
		T1.start();
		T2.start();
	}

}
class ByB implements Runnable{

	@Override
	public void run() {
		for (int i = 0; i < 10; i++) {
			System.out.println(Thread.currentThread().getName() +i);
		}		
	}
	
}